home *** CD-ROM | disk | FTP | other *** search
- #include "xcmd.h"
- #include <FileMgr.h>
- #include <MacTypes.h>
- #include <string.h>
- #include <MemoryMgr.h>
- #ifdef XTEST
- #include <stdio.h>
- #endif
- /* this is the main program for the xcmd test jig
- * it defines the parameter block (for both HyperCard and FoxBase)
- * initializes it, sets up parameters and calls the xcmd
- */
-
-
- #ifdef XTEST
- /* prototype for xcmd under test */
- pascal void xserial(XCmdBlock *);
-
- main()
- {
- XCmdBlock b;
- XCmdBlock *pb;
-
- printf("\nStarting XCMD Test");
-
- pb = &b;
-
- /* initialize the xcmd block. THIS MUST BE DONE BEFORE ANY USE
- * OF THE BLOCK
- */
- xinit(pb);
-
- /* call xpars to set the xcmd's parameters prior to each call.
- * all parameters are strings. there can be 0 to 16 parameters.
- * xpars accepts a variable number of parameters; the last parameter
- * must be an empty string to terminate the list.
- */
- xpars(pb,"1","1200","N","8","1","S","R","");
- xserial(pb);
- printf("\n return value %s",*(pb->returnValue));
- wait(1);
-
- xpars(pb,"ATZ\r","");
- xserial(pb);
- printf("\n ATZ return value %s",*(pb->returnValue));
-
- wait(1);
- xpars(pb,"");
- xserial(pb);
- printf("\n return value %s",*(pb->returnValue));
-
- xpars(pb,"");
- xserial(pb);
- printf("\n return value %s",*(pb->returnValue));
-
- xpars(pb,"ATDP8231770\r","");
- xserial(pb);
- printf("\n DIAL return value %s",*(pb->returnValue));
-
- wait(30); /* wait for 30 seconds after dialing */
- xpars(pb,"");
- xserial(pb);
- printf("\n return value %s",*(pb->returnValue));
-
- xpars(pb,"");
- xserial(pb);
- printf("\n return value %s",*(pb->returnValue));
-
-
- }
-
- #endif
-